import { readFileSync } from 'fs';
import { fileURLToPath } from 'url';
import { dirname, resolve } from 'path';

const autoImportConfig = JSON.parse(
  readFileSync(
    resolve(dirname(fileURLToPath(import.meta.url)), '.eslintrc-auto-import.json'),
    'utf-8'
  )
);

export default [
  {
    languageOptions: {
      globals: {
        ...autoImportConfig.globals, // 自动导入的全局变量
      },
    },
  },
];